package core.conditions;

import server.querry.Condition;
import infrastructure.exceptions.LoginException;
import infrastructure.exceptions.operations.OperationException;
import dal.User;

/**
 * This is a class that should be send to the server and determines that only the pets 
 * delivered by a specific user should be returned
 * @author sashas
 *
 */
public class PetsDeliveredByMe implements Condition{
	
	private static final long serialVersionUID = 8218979510417291732L;
	
	/** keeps user id of the user*/
	private String  userName;
	
	@Override
	public String getQuerry() {
		return "SELECT x FROM pets x WHERE x.deliver_User = (SELECT user FROM USERS user WHERE user.username like '" + userName + "')";
	}

}
